import { http } from '@/utils/http'

// 首先定义接口返回的类型
interface ProjectResponse {
  list: Array<{
    id: string
    smpName: string
    // 其他项目相关字段...
  }>
}

interface BookingResponse {
  list: Array<{
    bookingName: string
    bookingStatus: string
    bookingSetting: string
    startTime: string
    endTime: string
    oneNumber: number
    // 其他订场相关字段...
  }>
}

interface TicketResponse {
  list: Array<{
    ticketName: string
    ticketStatus: string
    validTime: string
    validNextNumber: number
    marketStartDate: string
    marketEndDate: string
    // 其他购票相关字段...
  }>
}

/** 项目接口 */
export const stadiumManageProjectPage = (data: object) => {
  return http.post<ProjectResponse>('/sportCardApi/stadiumManageProject/page', data)
}

/** 项目订场列表接口 */
export const bookingPage = (data: object) => {
  return http.post<BookingResponse>('/sportCardApi/booking/page', data)
}

/** 项目门票列表接口 */
export const ticketPage = (data: object) => {
  return http.post<TicketResponse>('/sportCardApi/ticket/page', data)
}

/** 订场详情 */
export const bookingDetails = (data: object) => {
  return http.post('/sportCardApi/booking/get', data)
}

/** 查询已定场次 */
export const bookingListOutBooking = (data: object) => {
  return http.post('/sportCardApi/booking/listOutBooking', data)
}

/** 订场规则 */
export const bookingListRule = (data: object) => {
  return http.post('/sportCardApi/booking/listRule', data)
}

/** 订场周期列表 */
export const bookingPagePeriod = (data: object) => {
  return http.post('/sportCardApi/booking/pagePeriod', data)
}
// 购票详情接口
export const ticketDetails = (data: object) => {
  return http.post('/sportCardApi/ticket/get', data)
}

/** 提交订场 */
export const submitBooking = (data: object) => {
  return http.post('/sportCardApi/bookingUser/save', data)
}

/** 提交购票 */
export const submitTicket = (data: object) => {
  return http.post('/sportCardApi/ticketUser/save', data)
}
